package cn.donting.plugin.spring.boot.starter.contorller;

import lombok.Getter;

/**
 *
 * @author donting
 *  2020-05-08 下午5:54
 */
@Getter
public class ResEntity {

    private int code;
    private String msg;
    private Object data;

    public ResEntity(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ResEntity success(Object data){
        return  new ResEntity(200,null,data);
    }
    public static ResEntity success(){
        return  new ResEntity(200,null,null);
    }
    public static ResEntity fall(String msg){
        return  new ResEntity(500,msg,null);
    }
}
